//导入全局模块
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import Vuex from "vuex";
import axios from "axios";
import * as echarts from "echarts";
import VueCookie from "vue-cookies";

//导入elementUI
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

//启用模块功能
Vue.use(router);
Vue.use(Vuex);
Vue.use(store);
Vue.use(ElementUI);
Vue.use(VueCookie);


//让ajax请求携带cookie
// axios.defaults.withCredentials=true;
//启用axios插件
Vue.prototype.$axios = axios;
//启用echarts
Vue.prototype.$echarts = echarts;

// Vue.$cookies.config("","","","","None")

Vue.config.productionTip = false;

new Vue({
    el: "#app",
    router,
    store,
    data: function () {
        return {
            new_link_flag: false,
            modify_nodeLocation_flag: false,
            new_link_style: {},
        };
    },
    components: {App},
    render: h => h(App),
}).$mount("#app");

// 页面跳转前工作
router.beforeEach((to, from, next) => {
    //动态修改标题
    if (to.meta.title) {
        document.title = to.meta.title;
    }
    next();
});

